﻿using System.Windows.Forms;

namespace MarioMapEditor
{
    public partial class FormBlackground : Form
    {
        private readonly MainForm _mParent;

        public FormBlackground(MainForm parent)
        {
            _mParent = parent;
            InitializeComponent();
            comboBox1.SelectedIndex = 0;
        }

        private void Button1MouseDown(object sender, MouseEventArgs e)
        {
            ObBlackground.INFO info;
            var temp = comboBox1.SelectedIndex;
            switch (temp)
            {
                case 0:
                    info = ObBlackground.INFO.S10;
                    break;
                case 1:
                    info = ObBlackground.INFO.S20;
                    break;
                case 2:
                    info = ObBlackground.INFO.S40;
                    break;
                case 3:
                    info = ObBlackground.INFO.S80;
                    break;
                default:
                    info = ObBlackground.INFO.S10;
                    break;
            }
            _mParent.CreateBlackground((int)info);
            Close();
        }
    }
}
